const http = require('http')
const server = http.createServer((req,res) => {
    //处理跨域问题
    res.writeHead(200,{
        'Access-Control-Allow-Origin':'http://127.0.0.1:5500'

    })
    //向超超的后端发送请求，拿到数据返回前端
    http.request({
        host:'192.168.1.75',
        port:3000,
        method:'GET',
        path:'/',
        headers:{}
    },(ProxyRes) => {
        ProxyRes.on('data',(data) => {
            res.end(data.toString())
        })
    }).end()
})
server.listen(3000,() => {
    console.log('server is running at http://localhost:3000')
})
